// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import Vconsole from 'vconsole'
import store from './store'
// 自定义指令
import Directives from './utils/directives'
Vue.use(Directives)
// UI
import Vant from 'vant'
import 'vant/lib/index.css'
Vue.use(Vant)
// 引入微信的sdk
import wx from 'weixin-js-sdk'
// 引入公共的方法
import func from './utils/public'
// 判断环境
const isWechat = () => {
  return String(navigator.userAgent.toLowerCase().match(/MicroMessenger/i)) === 'micromessenger'
}
Vue.prototype.$isWx = isWechat()
// 挂载微信的sdk
Vue.prototype.$wx = wx
// 挂载全局共用的方法
Vue.prototype.$func = func
// 调试模式
if (process.env.NODE_ENV === 'development' && isWechat()) {
  new Vconsole()
}

Vue.config.productionTip = false

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>'
})
